package com.dawn.module.hospital.service;

import com.dawn.framework.common.pojo.CommonResult;
import com.dawn.framework.common.util.http.HttpUtils;
import com.dawn.module.hospital.controller.app.selfservice.vo.SelfServiceOpenReqVO;
import com.dawn.module.hospital.enums.BHConstants;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

/**
 * @description:
 * @author: cnsu-cmh
 * @time: 2024/8/8 18:06
 */
@Slf4j
@Service
public class SelfServiceService extends BHService {

    @Resource
    private StringRedisTemplate stringRedisTemplate;

    @Autowired
    private PatientService patientService;

    @Autowired
    private EhealthService ehealthService;


    public CommonResult open(SelfServiceOpenReqVO reqVO) {
        Map args = new HashMap();
        args.put("hisProvider",BHConstants.HIS_PROVIDER);
        args.put("patientId",reqVO.getPatientId());
        CommonResult httpResult = CommonResult.error(ERROR_CODE,"未查询到数据");
        //驾驶员体检自助开单
        if("driver".equals(reqVO.getOpenType())) {
            httpResult = HttpUtils.getHttp(getHisServerUri() + BHConstants.HIS_DRIVER_OPEN.getValue(), args);
        }
        return httpResult;
    }

}
